<template>
	<view class="con">
		<!-- <view class="item">
			<view class="name">张三</view>
			<view class="i_r">
				<view class="co">男，25岁，65Kg</view>
				<u-icon name="arrow-right" color="#999" size="32"></u-icon>
			</view>
		</view>
		<view class="item">
			<view class="name">张三</view>
			<view class="i_r">
				<view class="co">男，25岁，65Kg</view>
				<u-icon name="arrow-right" color="#999" size="32"></u-icon>
			</view>
		</view>
		<view class="btn" @click="toadd">
			添加
		</view> -->
		<view v-if="type==0">
			<view class="item">
				<view class="name">姓名</view>
				<view class="i_r">
					{{info.idName}}
				</view>
			</view>
			<view class="item">
				<view class="name">身份证号码</view>
				<view class="i_r">
					{{info.idNumber}}
				</view>
			</view>
			<view class="item">
				<view class="name">疾病史</view>
				<view class="i_r" v-if="info.userHealthy.diseaseId!=''||info.userHealthy.detailed!=''">
					{{info.userHealthy.diseaseId}}{{info.userHealthy.detailed}}
				</view>
				<view class="i_r" v-else>
					无疾病史
				</view>
			</view>
		</view>
		<view v-if="type==1">
			<view class="item">
				<view class="name">姓名</view>
				<view class="i_r">
					{{info.idName}}
				</view>
			</view>
			<view class="item">
				<view class="name">身份证号码</view>
				<view class="i_r">
					{{info.idNumber}}
				</view>
			</view>
			<view class="item">
				<view class="name">亲属联系人</view>
				<view class="i_r">
					{{info.userHealthy.familyName}}
				</view>
			</view>
			<view class="item">
				<view class="name">亲属联系人手机号</view>
				<view class="i_r">
					{{info.userHealthy.familyPhone}}
				</view>
			</view>
			<view class="item">
				<view class="name">常用联系人</view>
				<view class="i_r">
					{{info.userHealthy.peopleName}}
				</view>
			</view>
			<view class="item">
				<view class="name">常用联系人手机号</view>
				<view class="i_r">
					{{info.userHealthy.peoplePhone}}
				</view>
			</view>
			<view class="item">
				<view class="name">疾病史</view>
				<view class="i_r" v-if="info.userHealthy.diseaseId!=''||info.userHealthy.detailed!=''">
					{{info.userHealthy.diseaseId}}{{info.userHealthy.detailed}}
				</view>
				<view class="i_r" v-else>
					无疾病史
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	import {getjkinfo} from"../../../api/user.js"
	export default{
		data(){
			return{
				info:{},
				type:null
			}
		},
		onLoad() {
			this.getinfo()
			let data=uni.getStorageSync("user")
			this.type=data.userType
		},
		methods:{
			toadd(){
				uni.navigateTo({
					url:"/pages/user/healthy/addhealthy"
				})
			},
			async getinfo(){
				let res=await this.get(getjkinfo)
				this.info=res.data
			}
		}
	}
</script>

<style>
	.btn{
		width: 690rpx;
		height: 66rpx;
		background: #F09238;
		opacity: 1;
		border-radius: 48rpx;
		position: fixed;
		bottom: 40rpx;
		left: 30rpx;
		text-align: center;
		line-height: 66rpx;
		color: #FFFFFF;
	}
	.co{
		font-size: 32rpx;
		font-weight: 400;
		color: #999999;
		opacity: 1;
		margin-left: 20rpx;
	}
	.name{
		font-size: 32rpx;
		font-weight: bold;
		color: #333333;
		opacity: 1;
	}
	.i_r{
		display: flex;
		align-items: center;
	}
	.item{
		display: flex;
		align-items: center;
		height: 110rpx;
		justify-content: space-between;
		border-bottom: 1px solid #EBEBEB;
	}
	.con{
		padding: 0 30rpx;
	}
</style>
